package com.xyoto.community.mapper.main;

import com.xyoto.community.entity.main.Proverb;
import org.springframework.stereotype.Repository;

/**
 * Author: 廖振辉
 * Date: 2021/11/17
 * Description: 金句表操作mapper
 */
@Repository
public interface ProverbMapper {
    /**
     * 从数据库中随机读取一条金句
     * @author 廖振辉
     * @return {@link Proverb}
     */
    Proverb selectOneByRandom();

    /**
     * 新增一条金句到数据库
     * @author 廖振辉
     * @param proverb
     * @return {@link Integer}
     */
    Integer insertOne(Proverb proverb);

    /**
     *
     * @author 廖振辉
     * @param id 金句id
     * @return {@link Proverb}
     */
    Proverb selectOneById(Integer id);

    /**
     * 根据金句id删除金句
     * @author 廖振辉
     * @param id 金句id
     * @return {@link Integer}
     */
    Integer deleteById(Integer id);
}
